package com.example.activiti.dataflow.listeners;


import com.example.activiti.common.utils.spring.SpringUtils;
import com.example.activiti.dataflow.DataFlowTaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.Expression;

/**
 * 用于清理数据量缓存的数据
 *
 * @author Administrator
 */
public class DataFlowEndStateListener implements ExecutionListener {
    private Expression state;

    @Override
    public void notify(DelegateExecution delegateExecution) {
        DataFlowTaskService dataFlowTaskService = SpringUtils.getBean(DataFlowTaskService.class);
        String processInstanceBusinessKey = delegateExecution.getProcessInstanceBusinessKey();
        dataFlowTaskService.clearFlowDataByProcessInstanceBusinessKey(processInstanceBusinessKey);
    }
}
